Next | Prev | Up | Top | Contents | Index

Mounting Filesystems Automatically With the /etc/fstab File

The /etc/fstab file contains information about every filesystem and swap partition that is to be mounted automatically when the system is booted into multi-user mode. In addition, the /etc/fstab file is used by the mount command when only the device block file or the mount point is given to the mount command. Filesystems that are not mounted with the mount command, such as the /proc filesystem, are not listed in /etc/fstab.

The procedure in this section explains how to add an entry for a filesystem to /etc/fstab.

For each filesystem that is to be mounted every time the system is booted, a line similar to this appears in the file /etc/fstab:

/dev/dsk/dks0d2s7 /test efs rw,raw=/dev/rdsk/dks0d2s7 0 0
The fields in this line are defined as follows:

/dev/dsk/dks0d2s7


The block device file of the partition where the filesystem is located.

/test

The name of the directory where the filesystem will be mounted (the mount point).

efs

The type of filesystem. In this case, the filesystem is an EFS filesystem.

rw, raw=

These are some of many options available when mounting a filesystem (see the fstab(4) reference page for a complete list). In this instance, the filesystem is to be mounted read-write, so that root and other users can write to it. The raw= option gives the filesystem's raw device filename. It should be the last option in the options list.

0 0

These two numbers represent the frequency of dump cycles and the fsck pass priority. These two numbers must be added after the last option in the options list (raw =). The fstab(4) reference page contains additional information.
If you have already mounted the filesystem as described in the section "Manually Mounting Filesystems," you can use the mount command to determine the appropriate /etc/fstab entry. For example:

mount -p 
This command displays all currently mounted filesystems, including the new filesystem in /etc/fstab format. Copy the line that describes the new filesystem to /etc/fstab.

The mount command reads /etc/fstab sequentially; therefore, filesystems that are mounted beneath other filesystems must follow their parent partitions in /etc/fstab in order for their mount points to exist.

The swap partition on the system disk (partition 1) is not listed in /etc/fstab. However, additional swap partitions added to the system are listed. For swap partitions, the mount point field is not used. See the guide IRIX Admin: System Configuration and Operation and the swap(1M) reference page for more information.

See the fstab(4) reference page for more information about /etc/fstab entries.


Next | Prev | Up | Top | Contents | Index